package com.nsgf.library.data.bean;

import java.util.List;

/**
 * 设备状态项包装类（用于适配器，支持普通设备和闸门组）
 */
public class DeviceStatusItem {
    public static final int TYPE_NORMAL = 0; // 普通设备
    public static final int TYPE_GATE_GROUP = 1; // 闸门组（water.obj.type.3）

    private int type;
    private DeviceOpeningBean.Devices device; // 普通设备数据
    private List<DeviceOpeningBean.Devices> gateDevices; // 闸门组数据（5个设备）

    private DeviceStatusItem(int type) {
        this.type = type;
    }

    /**
     * 创建普通设备项
     */
    public static DeviceStatusItem createNormal(DeviceOpeningBean.Devices device) {
        DeviceStatusItem item = new DeviceStatusItem(TYPE_NORMAL);
        item.device = device;
        return item;
    }

    /**
     * 创建闸门组项
     */
    public static DeviceStatusItem createGateGroup(List<DeviceOpeningBean.Devices> devices) {
        DeviceStatusItem item = new DeviceStatusItem(TYPE_GATE_GROUP);
        item.gateDevices = devices;
        return item;
    }

    public int getType() {
        return type;
    }

    public DeviceOpeningBean.Devices getDevice() {
        return device;
    }

    public List<DeviceOpeningBean.Devices> getGateDevices() {
        return gateDevices;
    }
}

